* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #2c3e50;
}

h2 {
    margin-bottom: 15px;
    color: #34495e;
}

h3 {
    margin-bottom: 10px;
    color: #555;
}

.main-content {
    display: flex;
    gap: 20px;
}

.left-column {
    flex: 3;
}

.right-column {
    flex: 1;
}

.room-section {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.room-section button {
    background: #3498db;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    margin-bottom: 15px;
    transition: background 0.3s;
}

.room-section button:hover {
    background: #2980b9;
}

.join-room {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.join-room input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

#room-info {
    font-weight: bold;
    color: #e74c3c;
}

/* ����ϵͳ��ʽ */
.rating-section {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

.rating-display {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 5px;
}

.rating-item {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.rating-item:last-child {
    margin-bottom: 0;
}

.rating-label {
    font-weight: bold;
    width: 80px;
    color: #555;
}

.star-rating, .star-rating-input {
    display: inline-flex;
    direction: ltr; /* 改为从左往右评分 */
    margin: 0 10px;
}

.star-rating .star, .star-rating-input .star-input {
    font-size: 24px;
    color: #ddd;
    cursor: pointer;
    transition: color 0.2s;
}

.star-rating .star:hover,
.star-rating .star:hover ~ .star {
    color: #FFD700; /* 金黄色 */
}

.star-rating-input .star-input:hover,
.star-rating-input .star-input:active,
.star-rating-input .star-input:hover + .star-input + .star-input + .star-input + .star-input,
.star-rating-input .star-input:hover + .star-input + .star-input + .star-input,
.star-rating-input .star-input:hover + .star-input + .star-input,
.star-rating-input .star-input:hover + .star-input {
    color: #ddd; /* 重置右侧星星颜色 */
}

/* 移除旧的相邻兄弟选择器样式 */
.star-rating-input .star-input:active {
    color: #FFD700; /* 点击时的金黄色 */
}

/* 为从左到右评分添加适当的hover效果 */
.star-rating-input:hover .star-input {
    color: #ddd;
}

.star-rating-input .star-input:hover,
.star-rating-input .star-input:hover ~ .star-input {
    color: #FFD700; /* 金黄色 */
}

/* ��ʾ���ֵ�������ʽ */
.star-rating .star.filled {
    color: #FFD700; /* �����޵Ļ�ɫ */
}

.rating-value {
    font-size: 18px;
    font-weight: bold;
    color: #e74c3c;
    margin: 0 10px;
    min-width: 40px;
}

.rating-count {
    font-size: 14px;
    color: #777;
}

.rating-form {
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 5px;
    background: #fafafa;
}

.rating-input-group {
    margin-bottom: 15px;
}

.rating-input-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

#submit-rating-btn {
    background: #f39c12;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s;
}

#submit-rating-btn:hover {
    background: #e67e22;
}

#rating-status {
    margin-top: 10px;
    font-size: 14px;
    color: #27ae60;
}

.video-section {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.video-container {
    margin-bottom: 20px;
    text-align: center;
}

video {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.upload-section {
    margin-bottom: 20px;
}

.upload-section input[type="file"] {
    margin-bottom: 10px;
    display: block;
}

.upload-section button {
    background: #27ae60;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s;
}

.upload-section button:hover {
    background: #229954;
}

#upload-status {
    margin-top: 10px;
    font-size: 14px;
    color: #e74c3c;
}

.control-section {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.control-section button {
    background: #9b59b6;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s;
}

.control-section button:hover {
    background: #8e44ad;
}

.progress-container {
    flex: 1;
    min-width: 300px;
    display: flex;
    align-items: center;
    gap: 10px;
}

#progress-bar {
    flex: 1;
    height: 8px;
    -webkit-appearance: none;
    appearance: none;
    background: #ddd;
    border-radius: 4px;
    outline: none;
    cursor: pointer;
}

#progress-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #3498db;
    cursor: pointer;
    transition: background 0.3s;
}

#progress-bar::-webkit-slider-thumb:hover {
    background: #2980b9;
}

#progress-bar::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #3498db;
    cursor: pointer;
    border: none;
    transition: background 0.3s;
}

#progress-bar::-moz-range-thumb:hover {
    background: #2980b9;
}

#time-display {
    font-size: 14px;
    color: #666;
    min-width: 100px;
}

@media (max-width: 1024px) {
    .main-content {
        flex-direction: column;
    }
    
    .rating-section {
        position: static;
        max-height: none;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .control-section {
        flex-direction: column;
        align-items: stretch;
    }
    
    .progress-container {
        min-width: auto;
    }
    
    .join-room {
        flex-direction: column;
    }
    
    .rating-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .rating-label {
        margin-bottom: 5px;
    }
    
    .star-rating, .star-rating-input {
        margin: 5px 0;
    }
    
    .left-column, .right-column {
        width: 100%;
    }
}

/* 视频选择模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-content {
    background-color: #fff;
    border-radius: 8px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 15px 20px;
    background-color: #3498db;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: white;
}

.close-btn {
    font-size: 24px;
    cursor: pointer;
    background: none;
    border: none;
    color: white;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s;
}

.close-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 15px 20px;
    background-color: #f1f1f1;
    text-align: right;
}

/* 视频列表样式 */
.video-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.video-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid #eee;
    transition: background-color 0.3s;
}

.video-item:hover {
    background-color: #f8f9fa;
}

.video-filename {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

.video-size {
    margin: 0 15px;
    color: #777;
    font-size: 14px;
}

.select-btn {
    background: #27ae60;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
    font-size: 14px;
}

.select-btn:hover {
    background: #229954;
}

/* 状态样式 */
.hidden {
    display: none;
}

#video-list-loading {
    text-align: center;
    padding: 20px;
    color: #777;
}

#video-list-empty {
    text-align: center;
    padding: 20px;
    color: #e74c3c;
}

#video-selection-status {
    margin-top: 15px;
    padding: 10px;
    border-radius: 5px;
    font-size: 14px;
    text-align: center;
}

/* 从已有视频选择按钮样式 */
#select-video-btn {
    background: #9b59b6;
    margin-left: 10px;
}

#select-video-btn:hover {
    background: #8e44ad;
}

#close-modal-btn {
    background: #7f8c8d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
    font-size: 16px;
}

#close-modal-btn:hover {
    background: #95a5a6;
}

/* 响应式模态框 */
@media (max-width: 768px) {
    .modal {
        padding: 10px;
    }
    
    .modal-content {
        max-height: 95vh;
    }
    
    .video-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .video-size {
        margin: 0;
    }
    
    .select-btn {
        align-self: flex-end;
        width: 100%;
        margin-top: 8px;
    }
}

/* index.html 特定样式 */
.header {
    text-align: center;
    margin-bottom: 50px;
    padding: 40px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 40px 30px;
}

.header-content h1 {
    margin: 0;
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
}

.header-content p {
    margin-top: 10px;
    font-size: 1.2rem;
    opacity: 0.9;
    color: white;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    color: white;
}

.logout-btn {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 5px;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.logout-btn:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

.feature-card {
    background: white;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-align: center;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    color: #667eea;
}

.feature-card h2 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.5rem;
    color: #333;
}

.feature-card p {
    color: #666;
    margin-bottom: 20px;
    line-height: 1.6;
}

.feature-btn {
    display: inline-block;
    padding: 12px 24px;
    background-color: #667eea;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.feature-btn:hover {
    background-color: #5a67d8;
}

.coming-soon {
    opacity: 0.7;
    position: relative;
}

.coming-soon .feature-btn {
    background-color: #e2e8f0;
    color: #4a5568;
    cursor: not-allowed;
}

.coming-soon .feature-btn:hover {
    background-color: #e2e8f0;
}

.coming-soon-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    background-color: #ed8936;
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: bold;
}

.footer {
    text-align: center;
    padding: 20px;
    color: #666;
    font-size: 0.9rem;
}

/* watch.html 特定样式 */
.nav-header {
    background-color: #333;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-radius: 10px;
}

.nav-header h1 {
    margin: 0;
    font-size: 1.8rem;
    color: white;
}

.site-logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    text-decoration: none;
}

.back-btn {
    background-color: #667eea;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.back-btn:hover {
    background-color: #5a67d8;
}

.nav-buttons {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-welcome {
    color: white;
    font-weight: 500;
    margin-right: 10px;
}

.nav-btn {
    background-color: #667eea;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.nav-btn:hover {
    background-color: #5a67d8;
}

.video-player-container {
    background-color: #000;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    position: relative;
}

.video-container {
    background-color: #000;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    position: relative;
}

.video-player,
#video-player {
    width: 100%;
    height: auto;
    max-height: 80vh;
    border-radius: 5px;
    display: block;
}

.rating-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    white-space: nowrap;
}

.rating-value, .rating-count {
    white-space: nowrap;
}

/* 登录注册页面样式 */
.auth-container {
    max-width: 400px;
    margin: 80px auto;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.auth-header {
    text-align: center;
    padding: 30px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.auth-header h1 {
    margin: 0 0 10px 0;
    font-size: 1.8rem;
    color: white;
}

.auth-header h2 {
    margin: 0;
    font-size: 1.3rem;
    opacity: 0.9;
    color: white;
}

.auth-form {
    padding: 30px 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.auth-btn {
    width: 100%;
    padding: 12px;
    background-color: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.auth-btn:hover {
    background-color: #5a67d8;
}

.auth-link {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: #666;
}

.auth-link a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.auth-link a:hover {
    text-decoration: underline;
}

.auth-error {
    margin-top: 15px;
    padding: 12px;
    background-color: #fee;
    border: 1px solid #fcc;
    border-radius: 5px;
    color: #c33;
    text-align: center;
}

.auth-success {
    margin-top: 15px;
    padding: 12px;
    background-color: #efe;
    border: 1px solid #cfc;
    border-radius: 5px;
    color: #393;
    text-align: center;
}

/* 响应式登录注册页面 */
@media (max-width: 768px) {
    .auth-container {
        margin: 40px 20px;
        max-width: none;
    }
    
    .auth-header,
    .auth-form {
        padding: 20px 15px;
    }
}